#!/usr/bin/env python
# -*- coding:utf-8 -*-
# Author:Richard_Kong
"""
读取参数化的json文件，并返回列表类型供测试用例参数化使用
"""
import json
from config import config


def read_json_para():
    """

    :return: list
    """
    test_data = []
    with open(file=config.json_path, mode='r', encoding='utf-8') as f:
        data = json.load(f)
        for case_data in data:
            login_data = case_data.get("login_data")
            success = case_data.get("success")
            code = case_data.get("code")
            message = case_data.get('message')
            test_data.append((login_data, success, code, message))

    return test_data


if __name__ == '__main__':
    test_data = read_json_para()
    print(test_data)
